















let datas = [
    [40, 0, 20, 2, 0],
    [40, 0, 23, 1, 0],
    [40, 0, 26, 1, 0],
    [40, 0, 23, 2, 0],
    [40, 0, 28, 1, 0],
    [40, 0, 26, 3, 0],
]


datas.forEach(item => {
    console.log(calcdmg(item[0],item[1],item[2],item[3],item[4]));
})


function calcdmg(dmgphy, dmgmono, wulikangx, baohu=0, pinzhang=0 ) {
    
    let phydmg = (dmgphy - baohu) * (1 - wulikangx/100)
    let monodmg = dmgmono - pinzhang
    if (monodmg < 0) {monodmg = 0}

    return phydmg + monodmg
}










